Skip to content

[Improve] Keep compact communication footers current with coding activity - #2415

Merged
brunobergher merged 18 commits into
developfrom
feature/live-comms-footer-2zog0frjgail2
Sep 10, 2026
Merged

[Improve] Keep compact communication footers current with coding activity#2415
brunobergher merged 18 commits into
developfrom
feature/live-comms-footer-2zog0frjgail2

Conversation

@roomote-roomote

@roomote-roomote roomote-roomote Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

​Opened on behalf of @mrubens. Follow up by mentioning @roomote-roomote, in the web UI, or in Slack.

What changed

  • Standardize communication footers as non-italic, middot-separated chunks: plain Reply anytime first; a plain 1 task running or <N> tasks running chunk only while work is running; linked pull requests next, comma-separated within one chunk when there are several; and linked Open in Roomote last.
  • Remove the Preview chunk and omit the task-count chunk when no task is running. Keep one and multiple pull request layouts compact without changing provider-native link formatting.
  • Keep each destination's latest footer current through the existing bounded refresh schedule. Preserve message bodies, controls, source-owned Session transcript URLs, UTM attribution, and the existing atomic lease and carrier safeguards.
  • Stop treating an unrendered Preview URL as active footer content, so preview-only idle Sessions can leave the 30-second refresh cadence and settle normally.
  • Update the Slack, Discord, Microsoft Teams, and Telegram documentation to describe the final footer behavior.

Why this change was made

Users need a consistent, compact way to reply, see active coding work, open created pull requests, and return to the Roomote transcript without stale status text or an extra Preview link.

Impact

Footer refresh remains eventually consistent: destinations with running tasks are checked about every 30 seconds, with bounded batches and retries that can add delay under load. Automated coverage exercises zero, one, and multiple running tasks and pull requests across communication and source-control providers, including live 2 -> 1 -> 0 refresh transitions and preview-only settlement. Communication, Slack, SDK, API, package typechecks, docs validation, broken links, and the pre-push lint/type/knip gates pass. No browser screenshots or live external-provider end-to-end validation were performed.

@roomote-community

roomote-community Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

No new code issues found. See task

  • packages/communication/src/thread-reply-footer-delivery.ts:300 The post-edit pointer write can still restore a historical carrier after lease loss.
  • packages/communication/src/thread-reply-footer-delivery.ts:153 Delivery still writes the footer pointer after a non-atomic lease check.
  • packages/sdk/src/server/lib/fast-agent-parent-event.test.ts:81 The Redis mock rejects every atomic footer-pointer write, so the new Teams/Telegram paths only exercise stale-carrier cleanup.
  • packages/sdk/src/server/lib/source-control-fast-delivery.ts:1279 Source-control refresh writes the carrier pointer after a non-atomic lease check, so a stale edit can restore a historical carrier.
  • packages/sdk/src/server/lib/source-control-fast-delivery.ts:1297 A lease-loss refresh can overwrite a newer in-place update to the same carrier because cleanup only compares message IDs.
  • packages/sdk/src/server/lib/source-control-fast-delivery.ts:924 Recovery can overwrite a subsequent same-comment update when its provider edit outlives the lock lease.
  • packages/sdk/src/server/lib/source-control-fast-delivery.ts:956 Recovery gives up after three further lease losses, leaving its final stale provider edit able to overwrite a newer same-comment update.
  • packages/communication/src/chat-messages.ts:304 The shared footer formatting change leaves Slack's direct-builder assertions expecting the former italic Web app footer, so the Slack package tests fail.
  • packages/communication/src/chat-messages.ts:313 Removing preview output leaves preview-only idle sessions on the 30-second active refresh cadence indefinitely.

Reviewed 4357f7c

Comment thread packages/communication/src/thread-footer-refresh.ts Fixed
Comment thread packages/communication/src/thread-reply-footer-delivery.ts Outdated
@roomote-roomote

roomote-roomote Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

Latest simplification: d689adba.

Removed generic footer deletion of task, artifact, and v query parameters. The context resolver and Fast URL builder already construct the plain Session transcript URL at its source, so the formatter does not need to repair it. Separate running-task navigation and UTM forwarding remain unchanged. Added source-to-footer coverage for the actual resolved Session URL.

All 316 communication tests, communication TypeScript, and pre-push checks pass locally. Fresh GitHub Test, Type Check, Lint and Knip pass; Roomote review, JavaScript CodeQL analysis and build are still running. Previous mention-footer removal and Redis mock fixes remain intact.

Comment thread packages/communication/src/thread-reply-footer-delivery.ts
@roomote-roomote
roomote-roomote Bot marked this pull request as ready for review September 9, 2026 19:44
Comment thread packages/sdk/src/server/lib/fast-agent-parent-event.test.ts
- Compare Slack footer text after decoding the entities Slack escapes on
  read-back, so unchanged footers no longer trigger an edit every tick.
- Report what each refresh learned: active destinations re-check every
  30 seconds, idle ones every 5 minutes, and settled or unresolvable ones
  unregister instead of polling for the record's whole lifetime.
- Lease claimed targets past the scheduler cadence, run one pass at a time
  under a job lock with a deadline, and reschedule explicitly.
- Resolve state outside the destination lock and hold it only for the
  provider edit; refreshes try the lock once, deliveries wait longer, and
  the Slack details toggle tells the user when the thread is busy.
- Check the KEEPTTL XX result so an edit on an expired record strips its
  own footer instead of leaving an orphan.
- Strip the footer from the previous source-control comment when a new
  turn relocates it.
- Keep the thread's own task selected when a task footer opens the owning
  Session, and keep caller-owned navigation such as setup links.
- Carry pull request links a refresh cannot re-derive until the database
  says they are closed; text providers post the caller's footer as-is.
- Resolve every linked task's latest run in one query.
- Document the compact footer on the provider pages.
Comment thread packages/sdk/src/server/lib/source-control-fast-delivery.ts Outdated
Write the source-control footer record and verify lock ownership in one
Redis operation, for both initial delivery and the post-edit refresh
write, so a lease that lapses after assertLock cannot repoint refresh at
a historical comment. A refresh whose write loses strips the footer it
just applied when a newer carrier exists.
Comment thread packages/sdk/src/server/lib/source-control-fast-delivery.ts Outdated
A competitor that loses the lease race can rewrite the same comment
rather than relocate the footer. Treat a different recorded body or
footer on the same comment id as the newer carrier and put its content
back, in both the delivery and refresh cleanup paths.
Comment thread packages/sdk/src/server/lib/source-control-fast-delivery.ts Outdated
Recovery after a lost footer lease re-reads the record and edits the
comment while holding the destination lock (the caller's lease when it
still holds it, otherwise a fresh one), so a later owner cannot persist
newer content between the read and the edit and be painted over.
A restoring provider edit can outlive its lease. Only a lease still held
after the edit proves nothing newer landed meanwhile; otherwise the
restoration starts over under a fresh lock, up to three times, comparing
the record against what it last wrote.
When a restoring edit's lease is lost after the edit, stop guessing:
mark the record's footer unknown under a fenced write and schedule a
refresh, so the next pass rewrites the comment from the record with its
own fenced post-edit write. The record, never a stale provider response,
decides what the comment shows.
Rename the footer's navigation link from "Web app" to "Open in Roomote"
on every communication and source-control surface, and render the footer
as plain text (Discord keeps its small-text prefix, GitHub its <sub>).
The refresh parser accepts both labels so footers posted before this
change keep refreshing.
… parser

The compact "Web app" footer never shipped; released footers were the
sentence style and are not registered for refresh, so only "Open in
Roomote" needs to parse. Align the remaining Slack and router test
fixtures with the plain, renamed footer.
Comment thread packages/communication/src/chat-messages.ts
@roomote-roomote

roomote-roomote Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

Completed in 4357f7ce.

The footer now renders Reply anytime first, an unlinked nonzero task count with singular/plural copy, created PR links as one comma-separated chunk, and Open in Roomote last. It has no italics or Preview chunk. Preview-only idle Sessions also settle instead of remaining on the active refresh cadence. Existing message bodies, controls, source-owned transcript URLs, UTM attribution, and lease/carrier safeguards remain intact; provider docs match the final behavior.

Passed: communication 331, Slack 478, SDK 1,811, API 2,604, package TypeScript checks, docs validation and broken links, plus the full pre-push lint/type/knip gate. Browser proof was not applicable to these external-provider surfaces. No live provider end-to-end test was performed.

Comment thread packages/communication/src/chat-messages.ts
@brunobergher
brunobergher merged commit d01da0b into develop Sep 10, 2026
18 checks passed
@brunobergher
brunobergher deleted the feature/live-comms-footer-2zog0frjgail2 branch September 10, 2026 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants